/***************************************************************************
 *   Copyright (C) 2008 by Goliash   *
 *   goliash@goliash.net   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef PREFERENCESDIALOG_H
#define PREFERENCESDIALOG_H

#include <QDialog>
 #include <QtGui>
 #include <QObject>

#include "ui_preferencesdialog.h"
#include "ui_prefsdrives.h"
#include "ui_prefsfilters.h"
#include "preferences.h"

class PrefsDrivesWidget : public QWidget, public Ui::PrefsDrivesWidget
{
	Q_OBJECT
	public:
		PrefsDrivesWidget(QWidget * parent = 0);

		void setDevice(QString device);
		QString getDevice();
		void setData(Preferences * pref);
		void getData(Preferences * pref);	
		void createHelp();
};

class PrefsFiltersWidget : public QWidget, public Ui::PrefsFiltersWidget
{
	Q_OBJECT
	public:
		PrefsFiltersWidget(QWidget * parent = 0);
		
		void setData(Preferences * pref);
		void getData(Preferences * pref);
		void createHelp();

		void useFilterJPEG(bool b);
		bool filterJPEG();
		void useFilterTxt(bool b);
		bool filterTxt();
		void useFilterMp3(bool b);
		bool filterMp3();
		void useFilterPdf(bool b);
		bool filterPdf();
		// pictures tab
		void createThumbnail(bool b);
		bool thumbnail();
		void lookForExif(bool b);
		bool exif();
		void setThumbnailSize(int size);
		int thumbnailSize();
		// mp3 tab
		void setTagCharset(QString charset);
		QString tagCharset();
};

class PreferencesDialog : public QDialog, public Ui::PreferencesDialog
{
	Q_OBJECT

	public:
		PreferencesDialog(QWidget * parent = 0);
		~PreferencesDialog(){};

		// Pass data to the standard dialogs
		void setData(Preferences * pref);
	
		// Apply changes
		void getData(Preferences * pref);

	private:
		PrefsDrivesWidget * m_prefsDrives;
		PrefsFiltersWidget * m_prefsFilters;
		Preferences *prefs;

	private slots:
		void restoreDefaults();
		bool saveSettings();
};


#endif
